<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <link href="../src/img/favicon.ico" rel="shortcut icon" type="image/x-icon"/>
    <link rel="stylesheet" href="../node_modules/sweetalert/dist/sweetalert.css">
    <link rel="stylesheet" href="../src/css/font-some.css">
    <link rel="stylesheet" href="../src/css/app.less">
    <link rel="stylesheet" href="../src/css/primary.less">
</head>
<body>
    <div class="body" id="body" :class="{more:isfooter}" v-show="isShow" style="display: none">
        <div class="title-img" :style="{'background-image':'url('+detail.cover+')'}"></div>
        <div class="title-cont">{{ detail.title }}</div>

        <ul class="ul">
            <li class="li">
                <i class="huodong-icon40_time"></i>
                <div class="cont">{{ detail.event_time }}</div>
            </li>
            <li class="li" v-if="detail.site">
                <i class="huodong-icon40_addr"></i>
                <div class="cont">{{ detail.site }}<!--<span class="icon-arrow1"></span>--></div>
            </li>
        </ul>

        <ul class="ul" v-if="detail.apply_num>0">
            <li class="li">
                <i class="huodong-icon40_user"></i>
                <div class="cont">已{{ detail.apply_num }}人报名
                    <ul class="heads">
                        <li v-for="item in detail.apply_list" :style="{'background-image':'url('+item.avatar+')'}"></li>
                    </ul>
                </div>
            </li>
        </ul>

        <dl class="explain" v-if="detail">
            <dt>活动介绍</dt>
            <dd v-html="common().converBr(detail.desc)"></dd>
        </dl>

        <a class="scroll"></a>

        <form class="forms" v-show="isShow=='signUp'">
            <div class="close" @click="checkout(true)"><i class="icon-close"></i></div>
            <div class="tit">填写报名表</div>
            <!--循环表单-->
            <div class="group" v-for="(item,index) in forms" :key="index">
                <div class="group-input" v-if="item.fieldname == 'username'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="32" v-model="item.value">
                    <label>姓名 <span v-if="item.required==1">*</span></label>
                </div>
                <div class="group-input" v-if="item.fieldname == 'mobile'">
                    <input class="txt" :class="{focus:item.value}" type="tel" maxlength="11" v-model="item.value">
                    <label>手机号 <span v-if="item.required==1">*</span></label>
                </div>
                <div class="group-input" v-if="item.fieldname == 'mobile'">
                    <input class="txt" :class="{focus:code}" type="tel" maxlength="6" v-model="code">
                    <label>验证码 *</label>
                    <button type="button" id="btn">{{text}}</button>
                </div>
                <div class="group-input" v-if="item.fieldname == 'company'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="32" v-model="item.value">
                    <label>公司 <span v-if="item.required==1">*</span></label>
                </div>
                <div class="group-input" v-if="item.fieldname == 'job'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="32" v-model="item.value">
                    <label>职位 <span v-if="item.required==1">*</span></label>
                </div>
                <div class="group-input" v-if="item.fieldname == 'email'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="64" v-model="item.value">
                    <label>邮箱 <span v-if="item.required==1">*</span></label>
                </div>
                <div class="group-input" v-if="item.fieldname == 'industry'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="32" v-model="item.value">
                    <label>行业 <span v-if="item.required==1">*</span></label>
                </div>
                <div v-if="item.fieldname == 'sex'">
                    <h2>性别 <span v-if="item.required==1">*</span></h2>
                    <div class="group-ul">
                        <label for="nan">
                            <input type="radio" name="sex" id="nan" value="男" v-model="item.value">男
                        </label>
                        <label for="nv">
                            <input type="radio" name="sex" id="nv" value="女" v-model="item.value">女
                        </label>
                        <label for="mi">
                            <input type="radio" name="sex" id="mi" value="保密" v-model="item.value">保密
                        </label>
                    </div>
                </div>
                <!--单行文字-->
                <div class="group-input" v-if="item.fieldname.indexOf('field_')===0 && item.type == 'text'">
                    <input class="txt" :class="{focus:item.value}" type="text" maxlength="32" v-model="item.value">
                    <label>{{ item.label }} <span v-if="item.required==1">*</span></label>
                </div>
                <!--多行文字-->
                <div class="group-input" v-if="item.fieldname.indexOf('field_')===0 && item.type == 'textarea'">
                    <textarea class="txt" :class="{focus:item.value}" maxlength="168" v-model="item.value"></textarea>
                    <label>{{ item.label }} <span v-if="item.required==1">*</span></label>
                </div>
                <!--单选和多选-->
                <div v-if="item.fieldname.indexOf('field_')===0 && (item.type == 'radio' || item.type == 'checkbox')">
                    <h2>{{ item.label }} <span v-if="item.required==1">*</span></h2>
                    <div class="group-ul">
                        <label :for="opt" v-for="opt in item.opt" v-if="item.type == 'radio'">
                            <input type="radio" :name="item.fieldname" :id="opt" :value="opt" v-model="item.value">{{opt}}
                        </label>
                        <label :for="opt" v-for="(opt,i) in item.opt" v-if="item.type == 'checkbox'">
                            <input type="checkbox" :name="item.fieldname" :id="opt" :value="opt" v-model="item.value">{{opt}}
                        </label>
                    </div>
                </div>
                <!--下拉-->
                <div class="group-input" v-if="item.fieldname.indexOf('field_')===0 && item.type == 'select'">
                    <select v-model="item.value">
                        <option disabled value="">{{ item.label }} {{ item.required==1?'*':'' }}</option>
                        <option v-for="opt in item.opt">{{opt}}</option>
                    </select>
                </div>
                <!--上传照片-->
                <div class="upload" v-if="item.fieldname.indexOf('field_')===0 && item.type == 'file'">
                    <div class="btn" v-if="imgs.length == 0" @click="chooseImage()"><i class="icon-add"></i> {{ item.label }}</div>
                    <div class="imgbox" v-if="imgs.length > 0">
                        <div class="img">
                            <img :src="imgs[0].url" alt="">
                            <div class="loaded" v-if="!imgs[0].loaded">
                                <i class="icon-yxq"></i>
                            </div>
                        </div>
                        <div class="btn" @click="chooseImage()">点击替换图片</div>
                    </div>
                </div>
            </div>
           <!-- <div class="ispushnew">
                <label for="new">
                    <input type="checkbox" name="ispush" id="new" value="1" v-model="form.ispush" checked>我愿意接收推送消息
                </label>
            </div>-->
            <button class="submit" type="button" @click="submit()" v-show="forms">提  交</button>
        </form>

        <div class="ticket" v-show="isShow=='signIn'">
            <div class="close" @click="checkout(true)"><i class="icon-close"></i></div>
            <div class="h2">我的入场券</div>
            <div class="cont" v-if="tickets && tickets!='no'">
                <div class="tit">序列号</div>
                <div class="list" v-for="(item,index) in tickets.apply_list">
                    <i class="top"></i>
                    <div class="name">{{ item.code }} <span :class="{blue:item.status==1}">{{item.status==1?'未签到':'已签到'}}</span></div>
                    <div class="time">提交报名时间: {{ item.create_time }}</div>
                    <a class="anniu" @click="signIn(item.apply_id,index)" v-if="tickets.sign_allow==1 && item.status==1">签到</a>
                    <a class="qrcode-btn" @click="openQrcode(index)" v-if="item.status==1"><i class="huodong-icon50_ewm"></i></a>
                </div>
            </div>
            <div class="no" v-if="tickets=='no'">
                暂无入场券
            </div>
        </div>

        <div class="footer" v-show="isfooter">
            <a @click="checkout('signIn')">我的入场券</a>
            <a class="right" :class="{no:detail.status==1}" v-if="detail.status==1">尚未开始</a>
            <a class="right" v-if="detail.status==2" @click="checkout('signUp')">立即报名</a>
            <a class="right" :class="{end:detail.status==3}" v-if="detail.status==3">活动截止报名</a>
        </div>

        <div class="qrcode-box" v-if="isqrcodeShow">
            <div class="cont">
                <div class="close" @click="closeQrcode()"><i class="icon-close"></i></div>
                <div class="img">
                    <img :src="qrcode" alt="">
                </div>
                <dl>
                    <dt>序列号</dt>
                    <dd>{{ tickets.apply_list[qrIndex].code }}</dd>
                </dl>
            </div>
        </div>

    </div>
</body>
<script src="../src/lib/flexible.js"></script>
<script src="../node_modules/sweetalert/dist/sweetalert-dev.js"></script>
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/vue/dist/vue.js"></script>
<script src="../node_modules/vue-resource/dist/vue-resource.js"></script>
<script src="../src/lib/gt.js"></script>
<script src="../src/js/config.js"></script>
<script src="../src/js/primary.js"></script>
</html>